<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<style type="text/css"></style>
		<script type="text/javascript">
			function add() {
				var input1 = document.getElementById("text1");
				var input2 = document.getElementById("text2");
				var input3 = document.getElementById("text3");
				var add = parseInt(input1.value) + parseInt(input2.value)
				input3.value = add;

			}

			function jian() {
				var input1 = document.getElementById("text1");
				var input2 = document.getElementById("text2");
				var input3 = document.getElementById("text3");
				var jian = parseInt(input1.value) - parseInt(input2.value)
				input3.value = jian;

			}

			function cheng() {
				var input1 = document.getElementById("text1");
				var input2 = document.getElementById("text2");
				var input3 = document.getElementById("text3");
				var cheng = parseInt(input1.value) * parseInt(input2.value)
				input3.value = cheng;

			}

			function chu() {
				var input1 = document.getElementById("text1");
				var input2 = document.getElementById("text2");
				var input3 = document.getElementById("text3");
				var chu = parseInt(input1.value) / parseInt(input2.value)
				input3.value = chu;

			}
		</script>
	</head>
	<body>
		<div>
			<table border="1">
				<tr>
					<td>
						<img src="img/logo.jpg" />
						<td colspan="3">
							<h3>购物简易计算器</h3>
						</td>
					</td>
				</tr>
				<tr>
					<td>第一个数</td>
					<td colspan="3">
						<input id="text1" value=" " type="text" />
					</td>
				</tr>
				<tr>
					<td>第二个数</td>
					<td colspan="3">
						<input id="text2" value=" " type="text" />
					</td>
				</tr>
				<tr>
					<td>
						<input type="button" onclick="add()" value="+" />
					</td>
					<td>
						<input type="button" onclick="jian()" value="-" />
					</td>
					<td>
						<input type="button" onclick="cheng()" value="*" />
					</td>
					<td>
						<input type="button" onclick="chu()" value="/" />
					</td>
				</tr>
				<tr>
					<td>运算结果</td>
					<td colspan="3">
						<input id="text3" type="text" />
					</td>
				</tr>
			</table>
		</div>

	</body>

</html>